function setRem() {
  //视口的宽度
  let clientWidth = parseInt(document.documentElement.clientWidth)
  let body=document.body
  if(clientWidth>750){
    clientWidth=750
    body.style.margin='0 auto'
  }
  //计算比例
  let rate = (clientWidth / 750) * 100
  console.log(clientWidth, rate)
  //document.documentElement===html
  document.documentElement.style.fontSize = rate + 'px'
}
window.onload = setRem
window.onresize = setRem
